#pragma once

class CExcptn
{
public:
	CExcptn(const CExcptn & rh ) 
	{
		m_ss << rh.m_ss.str();
	}

	void operator = (const CExcptn & rh) 
	{
		_ASSERT(0);
		m_ss.str("");
		m_ss << rh.m_ss.str();
	}

	CExcptn() {}
	CExcptn(LPCTSTR stzFile, long nLine)
	{
		m_ss << _T("Exception at: ") << stzFile << _T(":") << nLine << _T("\n");
	}

	~CExcptn()
	{
	}

	template <typename T>
	CExcptn & operator << (const T & t)
	{
		m_ss << t;
		return *this;
	}

	tstring GetString() const {	return m_ss.str();	}

protected:
	ostringstream m_ss;
};

#define THROW_EXCPTN throw CExcptn(__FILE__, __LINE__)